package day6.demo1;

import java.util.Objects;

public class Emp {
    String name;
    int age;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Emp emp = (Emp) o;
        return age == emp.age && name.equals(emp.name);
    }

    @Override
    public int hashCode() {
        return age;
    }
}
